<template>
    <div calss="user-info">
        <el-descriptions title="我的详情资料" :column="1" border style="margin: 20px;">
            <el-descriptions-item label="用户名">{{user.username}}</el-descriptions-item>
            <el-descriptions-item label="真实姓名">{{user.realname}}</el-descriptions-item>
            <el-descriptions-item label="电话">{{user.phone}}</el-descriptions-item>
            <el-descriptions-item label="最近登录时间">{{user.gmtLastLogin}}</el-descriptions-item>
            <el-descriptions-item label="角色">
                <el-tag v-for="(item,index) in user.roles" :key="index">
                    {{item}}
                </el-tag>
            </el-descriptions-item>
            <el-descriptions-item label="状态">
                <el-tag effect="dark" :type="user.status?'':'info'">
                    {{user.status?"正常":"异常"}}
                </el-tag>
            </el-descriptions-item>
        </el-descriptions>
    </div>
</template>

<script lang="ts" setup>
    // 引入状态管理
import { useUserStore } from '@/stores/admin/index'
const store = useUserStore()
let user = store.user
</script>

